Skip to content

feat(secret-scan): add severity-aware failure policies - #11

Merged
gmanal merged 2 commits into
mainfrom
feat/secret-scan-fail-policy
Jul 22, 2026
Merged

feat(secret-scan): add severity-aware failure policies#11
gmanal merged 2 commits into
mainfrom
feat/secret-scan-fail-policy

Conversation

@gmanal

@gmanal gmanal commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Replace the boolean fail-on-findings input with a constrained fail-policy input supporting all, verified, and none.

  • Preserve fail-closed behavior with all as the default.
  • Allow verified secrets to fail while unverified findings only warn.
  • Keep scanner infrastructure errors blocking under every policy.
  • Emit one policy-consistent annotation per scan outcome.
  • Update consumer examples and changelog documentation.

@gmanal
gmanal force-pushed the feat/secret-scan-fail-policy branch from be7c0c4 to f9d7d40 Compare July 20, 2026 17:48
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/secret-scan-pulse.yml
Comment thread .github/workflows/secret-scan-pulse.yml Outdated
@gmanal
gmanal force-pushed the feat/secret-scan-fail-policy branch from fa202db to d64c9ef Compare July 21, 2026 08:03
Make failure_policy the single enforcement lever for the Pulse reusable
workflow, with names and default matching the GitLab secret-scan component so
the GitLab and GitHub surfaces behave identically.

failure_policy (default unverified):
- unverified — fail on verified/live secrets (exit 183); keep the job green on
  unverified findings (exit 185).
- strict — fail on any finding (183 or 185).
- all — warn only; never fail the job on findings.
Scanner/infra errors always fail closed; missing scan state fails the job.

Scan and reporting:
- Remove the caller-facing `results` input. The scan always runs with the
  broadest filter (--results=verified,unknown,unverified) so every finding
  class — including unverified findings such as private keys — reaches SARIF
  and is eligible for enforcement.
- SARIF labels each finding's verification state distinctly (verified /
  unknown / unverified), derived from the scanner's Verified + VerificationError
  fields; verified -> error, unknown/unverified -> warning, with the state also
  in properties.verificationState.

Testing:
- ci.yml exercises positive and negative cases across all three policies. The
  unverified and all negatives run end-to-end through the reusable workflow via
  the repo-guarded, CI-only ci_test_setup input (both expected to pass); the
  strict negative asserts the scanner's exact exit code (185).

Docs:
- README, workflow catalogue, and CHANGELOG updated.

Migration (pre-release interface change):
- Remove any `results:` input from consumer `with:` blocks.
- fail-on-findings: true  -> failure_policy: strict (or unverified to tolerate
  unverified findings)
- fail-on-findings: false -> failure_policy: all
@gmanal
gmanal force-pushed the feat/secret-scan-fail-policy branch from d64c9ef to 2ee7fba Compare July 21, 2026 08:08
@gmanal
gmanal requested a review from ftnv July 21, 2026 08:11
Comment thread .github/workflows/README.md Outdated
@gmanal
gmanal merged commit 69032f6 into main Jul 22, 2026
7 checks passed
@gmanal
gmanal deleted the feat/secret-scan-fail-policy branch July 22, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants